import uma from 'umtrack-wx'
import Vue from 'vue'
import 'weapp-cookie'
import App from './App'
import store from './store/index.js'
import WXP from 'minapp-api-promise'
import VueBus from 'vue-bus'
import api from './api/index'
import constParams from '@/js/const.js'  //  常量
import utils from './js/utils.js' //  工具库
import validator from '@/js/validator.js'   //  校验函数库
import env from './js/env.js'
import amapFile from'./js/lib/amap-wx.js';
import './styles/index.scss'

uma.init({
  appKey: '5f8f9e74c1122b44acfbf587',
  useOpenid: true,
  autoGetOpenid: true,
  debug: true
})

Vue.use(VueBus)

Vue.config.productionTip = false
App.mpType = 'app'

let myAmapFun = new amapFile.AMapWX({ key: env.amapKey });

Vue.prototype.$store = store
Vue.prototype.$WXP   = WXP      //  微信小程序所有API promise化，支持await、支持请求列队
Vue.prototype.$env   = env
Vue.prototype.$utils = utils
Vue.prototype.$check = validator
Vue.prototype.$const = constParams
Vue.prototype.$api   = api
Vue.prototype.$myAmapFun = myAmapFun
Vue.prototype.$uma = uma

const app = new Vue(App)
app.$mount()

